package org.plex.task.imp;

import java.util.ArrayList;
import java.util.List;

import org.plex.task.FormInstance;

import com.adobe.idp.Document;

public class FormInstanceImp implements FormInstance {

	private  com.adobe.idp.taskmanager.dsc.client.task.FormInstance formInstance;
	
	public FormInstanceImp( com.adobe.idp.taskmanager.dsc.client.task.FormInstance formInstance )throws NullPointerException
	{
		if(formInstance==null)
		{
           throw new NullPointerException();
		}
		this.setFormInstance(formInstance);
	}
	
	
	public String getAssignedPrincipalId() {
		// TODO Auto-generated method stub
		return formInstance.getAssignedPrincipalId();
	}

	public short getAssignedQueueType() {
		// TODO Auto-generated method stub
		return this.formInstance.getAssignedQueueType();
	}

	public short getCurrentDataType() {
		// TODO Auto-generated method stub
		return formInstance.getCurrentDataType();
	}

	public short getDataTypeIn() {
		// TODO Auto-generated method stub
		return this.formInstance.getDataTypeIn();
	}

	public short getDataTypeOut() {
		// TODO Auto-generated method stub
		return this.formInstance.getDataTypeOut();
	}

	public Document getDocument() {
		// TODO Auto-generated method stub
		return this.formInstance.getDocument();
	}

	public long getFormInstanceId() {
		// TODO Auto-generated method stub
		return this.formInstance.getFormInstanceId();
	}

	public short getTaskStatus() {
		// TODO Auto-generated method stub
		return this.formInstance.getTaskStatus();
	}

	public boolean isActionRequired() {
		// TODO Auto-generated method stub
		return this.formInstance.isActionRequired();
	}

	public boolean isDataEmpty() {
		// TODO Auto-generated method stub
		return this.formInstance.isDataEmpty();
	}

	public boolean isDocumentForm() {
		// TODO Auto-generated method stub
		return this.formInstance.isDocumentForm();
	}

	public boolean isItemUpdateRequired() {
		// TODO Auto-generated method stub
		return this.formInstance.isItemUpdateRequired();
	}

	public boolean isItemUpdated() {
		// TODO Auto-generated method stub
		return this.formInstance.isItemUpdated();
	}

	public boolean isUseTaskRoutes() {
		// TODO Auto-generated method stub
		return this.formInstance.isUseTaskRoutes();
	}

	public void setActionRequired(boolean isActionRequired) {
	      this.formInstance.setActionRequired(isActionRequired);
	}

	public void setDocument(Document document) {
		this.formInstance.setDocument(document);
		
	}

	public void setFormInstanceId(long formInstanceId) {
		// TODO Auto-generated method stub
	   this.formInstance.setFormInstanceId(formInstanceId);
	}

	public void setUseTaskRoute(boolean userTaskRoutes) {
		// TODO Auto-generated method stub
		this.formInstance.setUseTaskRoutes(userTaskRoutes);
	}

	public List<String> getActionList() {
	    List<String> list=new ArrayList<String>();
	    String[] actions=this.formInstance.getActionList();
	    for(String string : actions)
	    {
	    	list.add(string);
	    }
		return list;
	}

	public String getSelectedAction() {
		// TODO Auto-generated method stub
		return this.formInstance.getSelectedAction();
	}

	public String getTemplatePath() {
		// TODO Auto-generated method stub
		return this.formInstance.getTemplatePath();
	}

	public byte[] getXFAData() {
		// TODO Auto-generated method stub
		return this.formInstance.getXFAData();
	}

	public void setActionList(List<? extends String> actionList) {
		String[] string=new String[actionList.size()];
		int count=actionList.size();
		for(int i=0;i<count;i++)
		{
			string[i]=actionList.get(i);
		}
	    this.formInstance.setActionList(string);
	}

	public void setSelectedAction(String selectedAction) {
		
		this.formInstance.setSelectedAction(selectedAction);
	}

	public void setTemplatePath(String templatePath) {
		this.formInstance.setTemplatePath(templatePath);
		
	}

	public void setXFAData(byte[] xfaData) {
		this.setXFAData(xfaData);
		
	}


	public void setFormInstance(com.adobe.idp.taskmanager.dsc.client.task.FormInstance formInstance) {
		this.formInstance = formInstance;
	}


	public com.adobe.idp.taskmanager.dsc.client.task.FormInstance getFormInstance() {
		return formInstance;
	}

}
